<?php
namespace App\Http\Controllers\Guard;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class GuardController extends Controller{
    public function guard_index(){
        $info=DB::table("guard")->get();
        return view("Guard/index",["info"=>$info]);
    }
    public function guard_edit($id){
    	$info=DB::table("guard")->where("id",$id)->first();
    	return view("Guard/edit",['info'=>$info]);
    }
    public function guard_update(Request $r){
    	$data=$r->except('_token');
    	$info=DB::table("guard")->where("id",$data['id'])->update($data);
    	if($info){
    		return redirect("guard_index");
    	}else{
    		echo "修改失败";
    	}
    }
}